<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
	  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	  layout:decorate="~{layouts/layout}">
  <head>
    <meta charset="utf-8">
    <title>电子病历列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  </head>
  <body>
	<th:block layout:fragment="content">
		<div class="span9">
			<div class="row-fluid">
				<div class="page-header">
					<h1>电子病历列表</h1>
				</div>
				<table class="table table-striped table-bordered table-condensed">
					<thead>
					<tr>
						<th hidden="true">ID</th>
						<th>患者姓名</th>
						<th>就诊卡号</th>
						<th>病历名称</th>
						<th hidden="true">病历类型</th>
						<th>实例编号</th>
						<th>部门</th>
						<th>完成状态</th>
						<th>创建人</th>
						<th>创建时间</th>
						<th>操作</th>
					</tr>
					</thead>
					<tbody>
					<tr class="list-users" th:each="mr : ${medicalRecords}">
						<td hidden="true" th:text="${mr.id}"></td>
						<td th:text="${mr.patientName}"></td>
						<td th:text="${mr.visitCardNo}"></td>
						<td th:text="${mr.name}"></td>
						<td hidden="true" th:text="${mr.type}"></td>
						<td th:text="${mr.serialNumber}"></td>
						<td th:text="${mr.department}"></td>
						<td th:text="${mr.published} == 0 ? '未完成' : '已完成'"></td>
						<td th:text="${mr.createdBy}"></td>
						<td th:text="${#temporals.format(mr.createTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
						<td>
							<div class="btn-group">
								<a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">操作 <span class="caret"></span></a>
								<ul class="dropdown-menu">
									<li><a th:href="@{'/edit-emr-content?recordId='+ ${mr.id} + '&templateId=' + ${mr.templateId}}"><i class="icon-pencil"></i> 操作病历内容</a></li>
								</ul>
							</div>
						</td>
					</tr>
					</tbody>
				</table>
				<div class="pagination">
					<ul>
						<li><a href="#">Prev</a></li>
						<li class="active">
							<a href="#">1</a>
						</li>
<!--						<li><a href="#">2</a></li>-->
<!--						<li><a href="#">3</a></li>-->
<!--						<li><a href="#">4</a></li>-->
						<li><a href="#">Next</a></li>
					</ul>
				</div>
				<a th:href="@{/new-emr-list}" class="btn btn-success btn-large">新增病历</a>
			</div>
		</div>
	</th:block>

	<script>
		$(document).ready(function() {
			$('.dropdown-menu li a').hover(
			function() {
				$(this).children('i').addClass('icon-white');
			},
			function() {
				$(this).children('i').removeClass('icon-white');
			});

			if($(window).width() > 760)
			{
				$('tr.list-users td div ul').addClass('pull-right');
			}
		});
	</script>
  </body>
</html>
